package com.etc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.etc.dao.DoctorMapper;
import com.etc.entity.Doctor;
import com.etc.service.DoctorService;
@Service(value="doctorService")
public class DoctorServiceImpl implements DoctorService{
	@Autowired
	private DoctorMapper doctorMapper;

	
	/**
	 * 查询单个医生对象
	 */
	@Override
	public Doctor selectByPrimaryKey(Integer doctorid) {
		// TODO Auto-generated method stub
		return doctorMapper.selectByPrimaryKey(doctorid);
	}
	
	/**
	 * 查询所有医生信息
	 * 
	 * @return
	 */
	@Override
	public List<Doctor> queryBusers() {
		// TODO Auto-generated method stub
		return doctorMapper.queryBusers();
	}
	
	/**
	 * 添加医生
	 */
	@Override
	public int insDoctor(Doctor doctor) {
		// TODO Auto-generated method stub
		return doctorMapper.insert(doctor);
	}
	
	/**
	 * 修改医生信息
	 */
	@Override
	public int updDoctor(Doctor doctor) {
		// TODO Auto-generated method stub
		return doctorMapper.updateByDoctorId(doctor);
	}
	
	/**
	 * 查询医生总人数
	 */
	@Override
	public int countDoctor() {
		// TODO Auto-generated method stub
		int count = doctorMapper.countDoctor();
		return count;
	}
	
	/**
	 * 根据医生编号删除医生信息
	 */
	@Override
	public int delDoctor(int doctorid) {
		// TODO Auto-generated method stub
		return doctorMapper.delDoctor(doctorid);
	}
}
